public class Double4 {
    public static void main(String[] args) {
        int[][] a=new int[][]{
                {5,4,3,2,1},
                {6,5,4,3,0},
                {7,6,5,0,0},
                {8,7,0,0,0},
                {9,0,0,0,0},
        };

        for (int i = 0; i <5 ; i++) {
            for (int j=0;j<5;j++) {
                int t=a[i][j];
                a[i][j] = a[4 - j][4 - i];
                a[4-j][4-i]=t;
                if (i+j==4)
                    break;
            }
            
        }

        for (int i = 0; i <5 ; i++) {
            for (int j=0;j<5;j++)
                System.out.print(a[i][j]);
            System.out.println();
        }
        
    }
}
